package org.dtrd.modules.organization.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.organization.entity.bean.DoctorOrganizationDetail;


/**
 * <p>
 * 机构和医生关系表
 * </p>
 *
 * @author QR
 * @since 2021-12-14
 */
@Getter
@Setter
@TableName("dtrd_rl_doctor_organization")
public class DtrdRlDoctorOrganization {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 医生id
     */
    @TableField("doctor_id")
    private Integer doctorId;

    /**
     * 机构编码
     */
    @TableField("org_code")
    private String orgCode;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    @TableField("create_time")
    private Date createTime;

    public DtrdRlDoctorOrganization init() {
        isDel = 0;
        createTime = new Date();
        return this;
    }

    public DtrdRlDoctorOrganization parseFromDto(DoctorOrganizationDetail dto) {
        dataId = dto.getDataId();
        doctorId = dto.getDoctorId();
        orgCode = dto.getOrgCode();
        return this;
    }


}
